/*	Interface for all lower level behaviors.  Behaviors must implement these methods.
 *
*/

#ifndef BEHAVIOR_H_
#define BEHAVIOR_H_

#include <string>
#include "BaseBehavior.h"

class Behavior : public BaseBehavior
{
public:
	Behavior(std::string incName = "") : name(incName)
	{ 
		DEBUG_PRINT("Creating Behavior(%p) %s\n", this, name.c_str());
		control = new BehaviorController(this);	
	}
	
	~Behavior()	{}

	/**
     * Gets the controller reference.
     */
	BehaviorController* GetControl()	{	return control;	}

	/**
     * Gets the behavior name.
     */
	std::string GetName()	{	return name;	}

	virtual void Enter()		{	DEBUG_PRINT("Behavior(%p) %s Entering.\n", this, name.c_str());	}	// Call on start of behavior
	virtual void Execute()		{	DEBUG_PRINT("Behavior(%p) %s Executing.\n", this, name.c_str());	/*control->FinishWithSuccess();*/	}	// Call on action itself; this implements the main logic of the behavior
	virtual void Exit()			{	DEBUG_PRINT("Behavior(%p) %s Exiting.\n", this, name.c_str());	}	// Call at end of behavior

protected:
	
	/**
     * Behavior controler to keep track of the
     * Behavior state.
     */
	BehaviorController* control;

private: 
	/**
	 * Name for behavior
	 */
	std::string name;

};

#endif
